<template>
  <div></div>
</template>

<script>
import {
  setToken,
  setTenantId,
  removeToken,
  removeStoreId,
} from "@/utils/auth";
import { isRelogin } from "@/utils/request";
export default {
  name: "EryuoaStoreManageBackendTransit",

  data() {
    return {};
  },

  created() {
    let token = this.$route.query.token;
    let refreshToken = this.$route.query.refreshToken;
    let TenantId = this.$route.query.TenantId;

    removeToken();
    removeStoreId();

    this.$store.commit("SET_ROLES", []);
    this.$store.commit("SET_PERMISSIONS", []);

    setTenantId(TenantId);
    setToken({
      accessToken: token,
      refreshToken: refreshToken,
    });

    this.$nextTick(() => {
      this.$router.push({
        path: "/",
        params: {
          from: "t",
        },
      });
      // this.$store.dispatch("GetInfo").then(() => {
      //   isRelogin.show = false;
      //   this.$store.dispatch("GenerateRoutes").then((accessRoutes) => {
      //     this.$router.push({ path: "/" }).catch(() => {});
      //   });
      // });
    });
  },

  mounted() {},

  methods: {},
};
</script>

<style lang="scss" scoped></style>
